<?php
session_start();
$mod_title="игра-вы проиграли";
$mod_status="on";
if($mod_status=="on")
{
function mod_body($auth,$adminauth)
{
$level="";
$guildc="";
$arenac="";
if($auth=="ok")
{
$mcl="";
$mexp="";
$money="";
$query = "SELECT * FROM users WHERE login='$_COOKIE[login]'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$login,$pass,$mail,$reg,$class,$m,$h,$z,$s,$mon,$gold,$pms,$lvl,$ava,$ban,$online,$exp) = mysql_fetch_row($cat))
{
$mcl=$class;
$level=$lvl;
$money=$mon;
$mexp=$exp;
}
$query = "SELECT * FROM count";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$guild,$arena) = mysql_fetch_row($cat))
{
$guildc=$guild;
$arenac=$arena;
}
echo "
<img src='img/bo.png'> <a href='?do=game/char'>персонаж($level)</a>|<img src='img/bs.png'> <a href='?do=game/history'>история</a><br>
<br>
";
$_pg="0";
$ag="-10";
$_pg2="10";
if(!empty($_GET['_pg']))
{
$ag=$_GET['_pg']-"10";
$_pg=$_GET['_pg'];
$_pg2=$_GET['_pg']+"10";
}
$mob_name="";
$cvb1="";
$cvb2="";
$query = "SELECT * FROM battle WHERE login='$_COOKIE[login]'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($login,$nowh,$name,$s,$m,$h) = mysql_fetch_row($cat))
{
$mob_name=$name;
$cvb1=$nowh;
$cvb2=$h;
}
if($cvb1<0)
{
$mob_s="";
$mob_m="";
$mob_h="";
$expm1="";
$mm1="";
$query = "SELECT * FROM mobs WHERE name='$mob_name'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$name,$inst,$lvl,$s,$m,$h,$expp,$expm,$mp,$mm,$drop) = mysql_fetch_row($cat))
{
$mob_name=$name;
$mob_s=$s;
$mob_m=$m;
$mob_h=$h;
$expm1=$expm;
$mm1=$mm;
}
$mm11=$money-$mm1;
$expm11=$mexp-$expm1;
if($expm11>0)
{
}
else
{
$expm11="0";
}
$query="UPDATE users SET mon='$mm11',exp='$expm11' WHERE login='".$_COOKIE[login]."'";
$result=mysql_query($query)
or die("<span style='color:red'>ошибка обновления пользователя!</span><br>");
echo "<span style='color:red'>вы проиграли! -$mm1 серебра,-$expm1 exp.</span><br>";
include "data/level.php";
$query="DELETE FROM battle WHERE login='".$_COOKIE[login]."'";
$result=mysql_query($query)
or die("ошибка очистки!");
$query="DELETE FROM battlelog WHERE login='".$_COOKIE[login]."'";
$result=mysql_query($query)
or die("ошибка очистки #2!");
}
else
{
echo "HACKER?!<br>";
}
include "data/buttons.auth.php";
}
else
{
echo "
Ошибка авторизации!<br>
";
}
}
}
else
{
function mod_body($auth,$adminauth)
{
echo "мод выключен администратором!<br>";
}
}
?>